<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<!--只在模块名下面有效 -->
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>集团管理</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<div class="searchArea">
				<form id="searchBar">
					<div class="fieldset1 clearFix">
						<div class="fieldBox">
							<div class="label" style="width: 60px;">集团ID</div>
							<div class="field">
								<input name="sid" id="sid" type="text" class="ui-textbox" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label" style="width: 80px;">集团名称</div>
							<div class="field">
								<input name="name" id="name" type="text" class="ui-textbox" value="">
							</div>
						</div>
						<div class="clearFix"></div>
						<div class="btnsBox">
							<span id="searchBtn" class="sq-button sq-button-round">查询</span>
						</div>
					</div>
				</form>
			</div>
			<div id="ligergridDB" class="sq-grid"></div>
		</div>
	</div>
</body>
	<script type="text/javascript">
	var gridDB = null;
	var form = null ;
	var _token = '${token}'
	$(function () {
		gridDB = $("#ligergridDB").ligerGrid({
            headers:{
                token: _token
			},
            url: 'http://10.20.7.110:8090/sq/getGroupList',
            param:{'token':_token},
            method : 'post',
            contentType:'application/json',
            columns: [
                { display: '集团ID', name: 'id', minWidth: 10 ,align:'left', enabledSort:false},
                { display: '集团名称', name: 'name', minWidth: 50 ,align:'left', enabledSort:false},
                { display: '成员数量', name: 'num', minWidth: 50 ,align:'left', enabledSort:false}, 
                { display: '操作', name: 'num', minWidth: 50 ,align:'left', enabledSort:false,
                	render: function (rowdata, rowindex, value){
         	    	   var m="";
                        m+='<a class="sq-button-hasicon" href="javascript:showSplGroupMembersDetail(';
                        m+="'"+rowdata.id+"'";
                        m+=")\"><i class='sqBtnIco_1'></i>查看详情</a>";
						m+='<a class="sq-button-hasicon" href="javascript:showCapPrj(';
						m+="'"+rowdata.id+"'";
						m+=")\"><i class='sqBtnIco_1'></i>敞口统计</a>";
                        return m ;
                	}
                }, 
            ],
            pageSize:10,
            pageSizeOptions: [10, 20, 30, 40, 50, 100],//按照自己的喜好选择不同的页面显示条数
            root:'data',
            record:'count',
            hideLoadButton : true,
            width: '100%',
            height:'100%',
            heightDiff:-30,
            checkbox:true,
            rownumbers:true,
            fixedCellHeight: false,
            pageParmName:'currentPage',
            pagesizeParmName:'pageSize',
            /* onLoaded: function(grid) {
	            grid.data[grid.options.record] = 9100 // 劫持数据，改变数据
	            grid.toggleLoading(false); // 关闭Loading加载动画
	    }, */
        });
		gridDB.setHeight(100);

		form = $("#searchBar").ligerForm();
		
		
		$("#searchBtn").click(function(event) {
        	gridDB.setParm('id',null);
        	gridDB.setParm('name',null);
			
	        var data = form.getData();
	        console.log(JSON.stringify(data));
	        var id = data['sid'];
	        if(id){
	        	gridDB.setParm('id',data['sid']);
	        }
	        var name = data['name'];
	        if(name){
	        	gridDB.setParm('name',data['name']);
	        }
	        gridDB.reload();
	    });

});
	function showSplGroupMembersDetail(id){
		if(!id){
			
		}
		Add_navTab('tab_grp_relation_member_info'+id,'集团成员列表','<%=path%>/splGroup/relation/toMemberRelationPage.do?id='+id);
	}
	function showCapPrj(id){
		if(!id){

		}
		Add_navTab('tab_grp_relation_capprj_info'+id,'集团成员列表','<%=path%>/splGroup/relation/showCapPrj.do?id='+id);
	}
	
</script>


</html>
